import {combineReducers, createStore, applyMiddleware} from 'redux'
import thunk from 'redux-thunk' //支持异步action
import {composeWithDevTools} from 'redux-devtools-extension' //为了在控制台中看到redux的变化
import { loginReducer } from './reducer/user'
import { permissionReducer } from './reducer/permission'

//  汇总所有的reducer成一个总的reducer
const rootReducer = combineReducers({
  login: loginReducer,
  permission: permissionReducer
})

export default createStore(rootReducer,composeWithDevTools(applyMiddleware(thunk)) )